﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title>MergeColumns 合并单元格</title>
    <meta http-equiv="content-type" content="text/html; charset=UTF-8" />
     <script src="../../scripts/boot.js" type="text/javascript"></script> 
    
</head>
<body>
    
    <h1>MergeColumns 合并单元格</h1>
    <div id="datagrid1" class="mini-datagrid" style="width: 700px; height: 300px" 
        url="data2.txt" multiSelect="true"   showfooter="false">
        <div property="columns">
            <div type="checkcolumn" ></div> 
            <div field="rowid" name="rowid" width="50" align="center" headeralign="center">
                序号</div>
            <div field="" align="center" headeralign="center" width="160">
                指标
                <div property="columns" align="center">
                        <div field="Company" name="company" width="60" headeralign="center" allowsort="true" align="center">
                            公司
                        </div>
                        <div field="oiltypes" width="60" headeralign="center" allowsort="true" align="center">
                            油品
                        </div>
                    </div>
            </div>
            <div field="danwei" align="center" headeralign="center">
                单位</div>
            <div field="LastyearSum" headeralign="center" align="center">
                上年年度总量</div>
            <div field="This" headeralign="center" align="center">
                当月</div>

        </div>
    </div>

    <script type="text/javascript">
        mini.parse();
        var grid = mini.get("datagrid1");
        
        grid.on("load", function () {
            grid.mergeColumns(["rowid", "company"]);
        });

        grid.load();

    </script>

    <div class="description">
        <h3>Description</h3>
        <p>自动合并相同值的单元格</p>
    </div>
</body>
</html>
